function orderBy(...a){
    return a.sort();
}

console.log(orderBy(1,4,4,3,2,4,6));
// [ 1, 2, 3, 4, 4, 4, 6 ]